Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

long

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

long

A Long class for representing a 64-bit two's-complement integer value.

  • 5.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
36M
increased by6.03%
Maintainers
1
Weekly downloads
 
Created

What is long?

The 'long' npm package provides a comprehensive library for representing, converting, and performing arithmetic operations on 64-bit integers. This is particularly useful in environments like JavaScript, where the standard Number type can only safely represent integers up to 53 bits.

What are long's main functionalities?

Creation of Long integers

This feature allows the creation of 64-bit integers. The constructor takes two arguments representing the low and high 32 bits of the integer, respectively.

const Long = require('long');
let longVal = new Long(0xFFFFFFFF, 0x7FFFFFFF);

Arithmetic operations

This feature supports basic arithmetic operations such as addition, subtraction, multiplication, and division on 64-bit integers.

const Long = require('long');
let long1 = new Long(1, 0);
let long2 = new Long(1, 0);
let sum = long1.add(long2);

Comparison operations

This feature enables comparison operations like less than, greater than, equals, etc., between two Long instances.

const Long = require('long');
let long1 = new Long(1, 0);
let long2 = new Long(2, 0);
let isLessThan = long1.lessThan(long2);

Other packages similar to long

Keywords

FAQs

Package last updated on 16 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc